package com.totoro.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
 * @author TOTORO
 * @date 2021/8/9 22:11
 * 退货退款单POJO
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class PrimaryReturn extends PublicAttr{
    private int id;
    private String returnOdd;
    private String marketOdd;
    private int marketSrId;
    private int returnStatus;
    private int returnType;
    private String returnReason;
    private double returnMoney;
    private String returnDetail;

    private List<NegotiateHistory> negotiateHistories;
    private List<ReturnStatusInfo> returnStatusInfos;
    private List<PrtImages> prtImages;
    /** 在逻辑层映射成Map */
    private Map<String, ReturnStatusInfo> returnStatusInfoMap;
    private Map<String, List<PrtImages>> prtImageMap;
    /** 查询退款列表所需实体 */
    private MarketSrOrder marketSrOrder;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        PrimaryReturn that = (PrimaryReturn) o;
        return id == that.id && marketSrId == that.marketSrId && returnStatus == that.returnStatus && returnType == that.returnType && Double.compare(that.returnMoney, returnMoney) == 0 && returnOdd.equals(that.returnOdd) && marketOdd.equals(that.marketOdd) && returnReason.equals(that.returnReason) && returnDetail.equals(that.returnDetail) && negotiateHistories.equals(that.negotiateHistories) && returnStatusInfos.equals(that.returnStatusInfos) && prtImages.equals(that.prtImages) && returnStatusInfoMap.equals(that.returnStatusInfoMap) && prtImageMap.equals(that.prtImageMap) && marketSrOrder.equals(that.marketSrOrder);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), id, returnOdd, marketOdd, marketSrId, returnStatus, returnType, returnReason, returnMoney, returnDetail, negotiateHistories, returnStatusInfos, prtImages, returnStatusInfoMap, prtImageMap, marketSrOrder);
    }
}
